package com.xiaoshi.utils;

import java.util.UUID;

/**
 * @author sen
 * @description
 * @date 2023/4/27 17:04
 */

public class UUIDUtil {

    public static String random(){
        return UUID.randomUUID().toString().replace("-", "").toUpperCase();
    }

    public static SnowflakeIdWorker snowflakeIdWorker = new SnowflakeIdWorker(1,1);

    /**
     * @Description: 生成唯一订单id
     * @author: sen
     * @Date: 2023/4/27 17:04
     * @param
     * @return: {@link String}
     */
    public static String genOrderNo(){
        //String time = String.valueOf(System.currentTimeMillis());
        //String random = RandomStringUtils.randomNumeric(8);
        return snowflakeIdWorker.nextId()+"";
    }
}
